package com.ruoyi.lm.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lm.mapper.LmUserMapper;
import com.ruoyi.lm.domain.LmUser;
import com.ruoyi.lm.service.ILmUserService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-09-02
 */
@Service
public class LmUserServiceImpl implements ILmUserService 
{
    @Autowired
    private LmUserMapper lmUserMapper;

    /**
     * 查询用户
     * 
     * @param id 用户ID
     * @return 用户
     */
    @Override
    public LmUser selectLmUserById(String id)
    {
        return lmUserMapper.selectLmUserById(id);
    }


    /**
     * 查询用户
     *
     * @param openId 用户openId
     * @return 用户
     */
    @Override
    public LmUser selectLmUserByOpenId(String openId)
    {
        return lmUserMapper.selectLmUserByOpenId(openId);
    }

    /**
     * 查询用户列表
     * 
     * @param lmUser 用户
     * @return 用户
     */
    @Override
    public List<LmUser> selectLmUserList(LmUser lmUser)
    {
        return lmUserMapper.selectLmUserList(lmUser);
    }

    @Override
    public List<LmUser> selectUnReviewLmUserList(LmUser lmUser) {
        return lmUserMapper.selectUnReviewLmUserList(lmUser);
    }

    /**
     * 新增用户
     * 
     * @param lmUser 用户
     * @return 结果
     */
    @Override
    public int insertLmUser(LmUser lmUser)
    {
        lmUser.setCreateTime(DateUtils.getNowDate());
        return lmUserMapper.insertLmUser(lmUser);
    }

    /**
     * 修改用户
     * 
     * @param lmUser 用户
     * @return 结果
     */
    @Override
    public int updateLmUser(LmUser lmUser)
    {
        lmUser.setUpdateTime(DateUtils.getNowDate());
        return lmUserMapper.updateLmUser(lmUser);
    }

    /**
     * 删除用户对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLmUserByIds(String ids)
    {
        return lmUserMapper.deleteLmUserByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户信息
     * 
     * @param id 用户ID
     * @return 结果
     */
    @Override
    public int deleteLmUserById(String id)
    {
        return lmUserMapper.deleteLmUserById(id);
    }
}
